package com.kun.music.service.impl;

import com.kun.music.dao.CommentMapper;
import com.kun.music.domain.Comment;
import com.kun.music.service.CommentService;
import com.sun.xml.internal.ws.api.pipe.Tube;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.swing.table.TableRowSorter;
import java.util.List;

/**
 * @author fangkun
 * @create 2023-01-04-15:34
 */
@Service
public class CommentServiceImpl implements CommentService {

    @Autowired
    private CommentMapper commentMapper;

    @Override
    public List<Comment> getSongComment(int songId) {
        return commentMapper.getSongComment(songId);
    }

    @Override
    public List<Comment> getCommentOfSongListId(int id) {

        return commentMapper.getCommentOfSongListId(id);
    }

    @Override
    public boolean addComment(Comment comment) {
        return commentMapper.addComment(comment)>0 ? true : false;
    }

    @Override
    public boolean updateCommentMsg(Comment comment) {
        return commentMapper.updateCommentMsg(comment)>0 ? true : false;
    }
}
